//
//  ThreadCache.hpp
//  ThreadCache
//
//  Created by 卜绎皓 on 2023/1/31.
//

#ifndef ThreadCache_hpp
#define ThreadCache_hpp


#endif /* ThreadCache_hpp */


#include "Common.hpp"

class ThreadCache {
public:
    
    //申请对象
    void* Allocate(size_t size);
    void* Deallocate(void* ptr,size_t size);
    
    void* FetchFromCentralCache(size_t index,size_t size);
private:
    FreeList _freeLists[NFREELISTS];//哈希桶
};

//TLS - Thread Local Storage
static _declspec(thread) ThreadCache* pTLSThreadCache = nullptr;
